
from globally import LogFilePath_assignment, LogFilePath_exec
import logging

class Log:
    log_exec = logging.getLogger("exec")
    log_exec.setLevel(logging.DEBUG)
    handler_exec = logging.FileHandler(LogFilePath_exec, encoding="UTF-8")
    handler_exec.setFormatter(logging.Formatter("%(asctime)s - %(message)s"))
    log_exec.addHandler(handler_exec)

    log_assignment = logging.getLogger("assignment")
    log_assignment.setLevel(logging.DEBUG)
    handler_assignment = logging.FileHandler(LogFilePath_assignment, encoding="UTF-8")
    handler_assignment.setFormatter(logging.Formatter("%(asctime)s - %(message)s"))
    log_assignment.addHandler(handler_assignment)

    @classmethod
    def LOGExec(cls, info):
        if type(info) is str:
            cls.log_exec.info(info)
        if type(info) is list:
            for line in info:
                cls.log_exec.info(line)

    @classmethod
    def LOGAssignment(cls, level, info):
        if type(info) is str:
            cls.log_assignment.info(info)
        if type(info) is list:
            for line in info:
                cls.log_assignment.info(line)


